require("../css/commCss/normalize.less");
require("../css/commCss/reset.less");
require("../css/commCss/property.less");
require("../css/commCss/basic.less");
require("../fonts/iconfont.css");
require("../css/running.less");

//axios
const axios = require("axios");

//导入util
const util = require("../util/util");

document.addEventListener("DOMContentLoaded", function () {
  /* 获取元素 */
  const go=document.querySelector('#go')
  const runkm=document.querySelector('#runkm')//公里
  
   //点击go，跳转页面
  go.addEventListener('click',function(){
    location.href='./countdown.html'
  })

  /* 头部导航 */
  util.soprtTopNav("running");

  /* 底部导航 */
  util.fixBottomNav("running");
  

  let userId=localStorage.userId;
    axios.get('http://139.9.177.51:8099/sports/exerciseData?id='+userId)
    .then(function(res){
      let data=res.data.data

      //渲染跑步距离
      runkm.textContent=data.runkm;
    })
});
